{% extends 'TopxiaWebBundle:User:layout.html.twig' %}
{% block title %}在学{{ setting('classroom.name')|default("班级") }} - {{ parent() }}{% endblock %}
{% set pageNav = 'learning' %}
{% block main %}
  {% if classrooms %}
    <ul class="course-wide-list class-wide-list">
      {% for classroom in classrooms if classroom.status|default('') != 'closed' %}
        {% set teachers = classroom['teachers']|default(null) %}
        <li class="course-item clearfix">
          <a class="course-picture-link" href="{{ path('classroom_show', {id:classroom.id}) }}" target="_blank">
            <img class="course-picture" src="{{ filepath(classroom.middlePicture, 'classroom.png') }}" alt="{{ classroom.title }}">
          </a>
          <div class="course-body">
            <div class="title"><a class="link-light" href="{{ path('classroom_show', {id:classroom.id}) }}" target="_blank">{{classroom.title}}</a></div>
            <div class="class-student">
              <i class="fa fa-user" title="任课老师"></i>
              {% for teacher in teachers %}
                {% if loop.index <= 3%}
                  {{ teacher.nickname }}
                {% endif %}
              {% endfor %}&nbsp;&nbsp;
              <span class="hidden-xs hidden-sm">
                <i class="fa fa-users" title="学员数"></i>{{classroom.studentNum + classroom.auditorNum }} &nbsp;&nbsp;
              </span>
              <span class="hidden-xs hidden-sm stars-{{ classroom.rating|number_format }}">&nbsp;</span>
              <span class="hidden-xs hidden-sm rating-num">{{ classroom.rating|number_format(1) }}分</span>
              <span class="hidden-xs hidden-sm hidden-md">({{classroom.ratingNum}}评价)</span>
            </div>
            <div class="class-metas">
              <span class="course-num">课程总数:{{classroom.courseNum}}</span>
              <span class="period-num">课时总数:{{classroom.lessonNum}}</span>
            </div>
          </div>
        </li>
      {% endfor %}
    </ul>
  {% else %}
    <div class="empty">无在学的{{ setting('classroom.name')|default("班级") }}！</div>
  {% endif %}
{% endblock %}